<script setup>
// 引入
import { ref } from 'vue';
const car = ref('雷克萨斯')
const person = ref({
    name: '张三',
    age: 18
})
// 必须要加value
const changeAge = () => person.value.age++
const changeCar = () => car.value = "自行车"
</script>

<template>
    <div>
        <button @click="changeCar">换车</button>
        <span>{{ car }}</span>
        <span>{{ person }}</span>
        <button @click="changeAge">修改年龄</button>
    </div>
</template>

<style scoped></style>